package com.ruoyi.recycle.dto;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 普通用户管理对象 client_user_management
 * 
 * @author Wubk
 * @date 2022-05-21
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class ClientUserManagementDTO
{
    private static final long serialVersionUID = 1L;

    /** ID */
    @ApiModelProperty(name = "id",value = "普通用户管理id",dataType = "Long")
    private Long id;

    /** 用户名 */
    @Excel(name = "用户名")
    @ApiModelProperty(name = "userName",value = "用户",dataType = "String")
    private String userName;

    /** 手机号 */
    @Excel(name = "手机号")
    @ApiModelProperty(name = "phone",value = "手机号",dataType = "String")
    private String phone;

    /** 积分 */
    @Excel(name = "积分")
    @ApiModelProperty(name = "integral",value = "积分",dataType = "Long")
    private Long integral;

    /** 微信标识 */
    @ApiModelProperty(name = "openid",value = "微信标识",dataType = "String")
    private String openid;

    /** 创建人 */
    @ApiModelProperty(name = "createdBy",value = "创建人",dataType = "String")
    private String createdBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date searchTimeBegin;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date searchTimeEnd;

    /** 更新人 */
    private String updatedBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updatedTime;

    /**
     * 用户头像
     */
    private String img;

    /**
     * 用户定位所在城市
     */
    private String address;

    private Integer currentPage = 1;

    private Integer pageSize = 10;

    public void setSearchTimeEnd(Date searchEnd) {
        this.searchTimeEnd = DateUtil.offsetSecond(searchEnd, 86399).toJdkDate();

    }
}
